package CartService

import (
	"context"
	"gdshop-font-api-go/app/request/CartReq"
	"gdshop-font-api-go/app/service/CartServiceBase"
	"gdshop-font-api-go/library/response"
)

func Del(ctx context.Context, parames *CartReq.Del) *response.JsonResponse {
	_, err := CartServiceBase.Del(ctx, parames.Id, parames.MemberId)
	if err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	} else {
		return response.SuccessByRequestMessageData(nil, "成功",
			CartServiceBase.Count(ctx, parames.MemberId))
	}
}
